package com.atcc.test.domain;

import java.io.Serializable;
import java.sql.Timestamp;

public class CommonResult<T> implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -3137751987259725700L;

	/*
	 *   /是否成功
	 */
	private boolean success;
	
	/*
	 *  /返回的信息
	 */  
	private String message;
	
	/*
	 *  /返回成功或错误的消息码
	 */
    private String code;
    
    /*
     *  /返回的数据
     */
    private T data;
    
    /*
     *  /返回服务器当前时间（添加该字段的原因是便于查找定位请求时间，
                    / 因为实际开发过程中服务器时间可能跟本地时间不一致，加上这个时间戳便于日后定位）
     */
    
    private Timestamp currentTime;
    
    public CommonResult(){
    	 currentTime = new Timestamp(System.currentTimeMillis());
    }
    
    public CommonResult(boolean success,String message,String code) {
    	this.success=success;
    	this.message=message;
    	this.code=code;
    }
    
    public boolean isSuccess() {
    	return success;
    }

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public T getData() {
		return data;
	}

	public void setData(T data) {
		this.data = data;
	}

	public Timestamp getCurrentTime() {
		return currentTime;
	}

	public void setCurrentTime(Timestamp currentTime) {
		this.currentTime = currentTime;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}
    
	
    
    
}

